package cn.edu.jsu.official.pojo.vo;

import io.swagger.annotations.ApiModelProperty;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;

import java.util.Arrays;
import java.util.Date;

/**
 * @author Mo
 * @createTime 2022/2/27 14:05
 * @description
 */
public class CommonFile {
    @Id
    @ApiModelProperty(value = "主键Id")
    private String id;
    @ApiModelProperty("文件名称")
    private String name;
    @ApiModelProperty("文件类型")
    private String contentType;
    @ApiModelProperty("文件大小")
    private long size;
    @ApiModelProperty("文件第一次上传时间")
    private Date uploadDate;
    @ApiModelProperty("文件md5值")
    private String md5;
    @ApiModelProperty("文件后缀名")
    private String suffix;
    @ApiModelProperty("文件内容")
    private byte[] content;
    @ApiModelProperty("GridFsId")
    private ObjectId gridFsId;

    public CommonFile() {
    }

    public CommonFile(String id, String name, String contentType, long size, Date uploadDate, String md5, String suffix, byte[] content, ObjectId gridFsId) {
        this.id = id;
        this.name = name;
        this.contentType = contentType;
        this.size = size;
        this.uploadDate = uploadDate;
        this.md5 = md5;
        this.suffix = suffix;
        this.content = content;
        this.gridFsId = gridFsId;
    }

    @Override
    public String toString() {
        return "CommonFile{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", contentType='" + contentType + '\'' +
                ", size=" + size +
                ", uploadDate=" + uploadDate +
                ", md5='" + md5 + '\'' +
                ", suffix='" + suffix + '\'' +
                ", content=" + Arrays.toString(content) +
                ", gridFsId=" + gridFsId +
                '}';
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public Date getUploadDate() {
        return uploadDate;
    }

    public void setUploadDate(Date uploadDate) {
        this.uploadDate = uploadDate;
    }

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    public ObjectId getGridFsId() {
        return gridFsId;
    }

    public void setGridFsId(ObjectId gridFsId) {
        this.gridFsId = gridFsId;
    }
}
